#!/usr/bin/env bash
echo $1

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

case $1 in
    start) JRUBY_OPTS='' jruby --ng-server & ;;
    stop)  ps axww | grep '[c]om.martiansoftware.nailgun.NGServer' | grep -Po '^\s*(\d+)' | xargs kill ;;
esac
